using FarseerGames.FarseerPhysics;
using FarseerGames.FarseerPhysics.Factories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using XNA_2DFramwork;

namespace ArtificialIntelligence.Racing
{
    public class Cone:Obstacles
    {
        public Cone(Game game, Vector2 position, string filename, PhysicsSimulator PhysicsSimulator)
            : base(game)
        {
            Width = 140;
            Height = 80;
            Type = ObjectType.Obstacles;
            Texture = game.Content.Load<Texture2D>(filename);
            Position = position;
            this.PhysicsSimulator = PhysicsSimulator;
            Body = Body = BodyFactory.Instance.CreateRectangleBody(PhysicsSimulator, Width, Height, 1);
            Body.Position = position;
            Geom = GeomFactory.Instance.CreateRectangleGeom(PhysicsSimulator, Body, Width, Height);
            SpriteBatch = new SpriteBatch(game.GraphicsDevice);
            Body.IgnoreGravity = true;
            Geom.CollisionResponseEnabled = false;
            SpriteBatch = new SpriteBatch(Game.GraphicsDevice);
        }
         public override void Draw()
        {
            SpriteBatch.Begin();
            this.SpriteBatch.Draw(this.Texture, Body.Position, null, Color.White, Body.Rotation, Origin, 1f, SpriteEffects.None, 0f);
            SpriteBatch.End();
        }

         public  void Move(float x, float y)
        {
        }
         public override void Update()
        {
            this.Position.Y += RacePlayer.playerS;
            //Body.Position = Position;
        }
    }  
}

